/**
 * 订单
 */
import request from "@/server/request.js";

// 查询子账号下订单
export const childOrderNow = (params) => {
	return new request().requestGet(`/api/order/list`, params);
};

// 查询子账号下历史订单
export const childOrderHistory = (params) => {
	return new request().requestGet(`/api/order/history`, params);
};

// 订单详情
export const orderDetail = (orderId) => {
	return new request().requestGet(`/api/order/${orderId}`);
};

// 指定订单的收益
export const orderProfit = (orderId, params) => {
	return new request().requestGet(`/api/order/${orderId}/profit`, params);
};

// 指定订单的收益率
export const orderReturnRate = (orderId, params) => {
	return new request().requestGet(`/api/order/${orderId}/returnRate`, params);
};

// 一键平仓
export const orderClosePositions = (params) => {
	return new request().requestPost(`/api/order/closePositions`, params);
};